<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../layui/jquery-3.2.1.min.js"></script>
    <script src="../layui/layui.js"></script>
    <link href="../layui/css/layui.css" rel="stylesheet">
    <script src="js/purchaseIn.js"></script>
    <link href="css/purchaseIn.css"  rel="stylesheet">

</head>

<body>
    <h1 style="margin-left: 45%" >采购入库</h1>
    <!--采购栏基础信息-->
    <div id="purchaseBaseInfo">
        <span class="layui-text">供应商：</span>
        <select style="margin-left: 10px" id="sup" onchange="showBySup()"></select>
        <span class="layui-text" style="margin-left: 50px">采购人：</span><span id="user"></span>

    </div>

    <!--采购栏列表-->
    <div class="table">
        <table class="layui-table">
            <thead><tr><th>商品名称</th><th>厂家</th><th>建议采购价</th><th>建议销售价
            </th><th>采购数量</th><th>操作</th></tr></thead>
            <tbody id="productData">

            </tbody>
        </table>
        <a class="layui-btn layui-btn-warm" href="javascript:buy()">入库</a>
        <a class="layui-btn layui-btn-normal"href="javascript:showAdd()">添加商品</a>
    </div>

    <!--添加商品弹出层-->
    <div id="formDiv" style="display: none">


        <form class="layui-form" id="f1">
            <div style="display:flex;">
                <div style="width: 270px">
            <div class="layui-form-item">
                <label class="layui-form-label">商品编号</label>
                <div class="layui-input-block" >
                    <input type="text" name="id" id="proId" required  lay-verify="required" placeholder="请输入商品编号" autocomplete="off" class="layui-input" onblur="abc();" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">商品名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name"  id="proName"  lay-verify="required" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">厂家</label>
                <div class="layui-input-block">
                    <input type="text" name="vender" id="vender" required  lay-verify="required" placeholder="请输入厂家" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">类别</label>
                <div class="layui-input-block">
                    <select name="type" id="type" lay-verify="required"  >
                        <option>电脑产品</option>
                        <option>手机产品</option>
                        <option>办公耗材</option>
                        <option>办公设备</option>
                        <option>日常用品</option>
                        <option>其他</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">建议采购价</label>
                <div class="layui-input-block">
                    <input type="text" name="buyPrice" id="buyPrice" required  lay-verify="required" placeholder="请输入建议采购价" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">建议销售价</label>
                <div class="layui-input-block">
                    <input type="text" name="sellPrice" id="sellPrice" required  lay-verify="required" placeholder="请输入建议销售价" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">采购数量</label>
                <div class="layui-input-block">
                    <input type="text" name="num" id="num" required  lay-verify="required" placeholder="请输入采购数量" autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo" onclick="addProduct()">添加</button>
                </div>
            </div>
                </div>



            <div style="margin-top: 120px;margin-left: 150px;width: 150px">
                <div class="layui-form-item" style="margin-left: -30px">
                    <img id="picture" src="../img/1.jpg"  style="width: 100px;height: 100px;">
                    <input type="file" name="img" id="img"  style="margin-top: 30px" onchange="upLoad(this)">
                </div>
            </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" id="sup1" name="supId" required  lay-verify="required"  autocomplete="off" class="layui-input">
                </div>
            </div>
        </form>


    </div>







</body>
</html>